

export default function() {
  return async function(ctx: any, next: any) {
    try {
      await next();
    } catch (error) {
      ctx.status = 200;
      console.error(error);
      return ctx.body = {
        success: false,
        errorCode: -1,
        errorMessage: '内部服务器错误'
      };
    }
  };
}
